import { RMIBase } from "../../../common/net/RMIBase";
import { IOperationPrxHelper } from "../../../../Message/Game/IOperationPrxHelper";
import { ILoginGamePrxHelper } from "../../../../Message/Game/ILoginGamePrxHelper";
import { IBagPrxHelper } from "../../../../Message/Game/IBagPrxHelper";
import { IItemPrxHelper } from "../../../../Message/Game/IItemPrxHelper";
import { IRolePrxHelper } from "../../../../Message/Game/IRolePrxHelper";
import { IMountPrxHelper } from "../../../../Message/Game/IMountPrxHelper";
import { ITaskPrxHelper } from "../../../../Message/Game/ITaskPrxHelper";
import { IShopPrxHelper } from "../../../../Message/Game/IShopPrxHelper";
import { IInteractivePrxHelper } from "../../../../Message/Game/IInteractivePrxHelper";
import { IPlayerPrxHelper } from "../../../../Message/Game/IPlayerPrxHelper";
import { IFriendPrxHelper } from "../../../../Message/Game/IFriendPrxHelper";
import { IMailPrxHelper } from "../../../../Message/Game/IMailPrxHelper";
import { ITestPrxHelper } from "../../../../Message/Game/ITestPrxHelper";
import { IBusinessPrxHelper } from "../../../../Message/Game/IBusinessPrxHelper";
import { IPetPrxHelper } from "../../../../Message/Game/IPetPrxHelper";
import { IPetRentPrxHelper } from "../../../../Message/Game/IPetRentPrxHelper";
import { IGroupPrxHelper } from "../../../../Message/Game/IGroupPrxHelper";
import { IPanicBuyPrxHelper } from "../../../../Message/Game/IPanicBuyPrxHelper";
import { ICopyPrxHelper } from "../../../../Message/Game/ICopyPrxHelper";
import { IOfflineExpPrxHelper } from "../../../../Message/Game/IOfflineExpPrxHelper";
import { IToplistPrxHelper } from "../../../../Message/Game/IToplistPrxHelper";
import { IGuildPrxHelper } from "../../../../Message/Game/IGuildPrxHelper";
import { IStallPrxHelper } from "../../../../Message/Game/IStallPrxHelper";
import { IComprehensionTargetPrxHelper } from "../../../../Message/Game/IComprehensionTargetPrxHelper";
import { IRunBusinessPrxHelper } from "../../../../Message/Game/IRunBusinessPrxHelper";
import { IAcupointPrxHelper } from "../../../../Message/Game/IAcupointPrxHelper";
import { ITitlePrxHelper } from "../../../../Message/Game/ITitlePrxHelper";
import { IMarketPrxHelper } from "../../../../Message/Game/IMarketPrxHelper";
import { IActivePrxHelper } from "../../../../Message/Game/IActivePrxHelper";
import { IDelegatePrxHelper } from "../../../../Message/Game/IDelegatePrxHelper";
import { IMarryPrxHelper } from "../../../../Message/Game/IMarryPrxHelper";
import { IPetEquipPrxHelper } from "../../../../Message/Game/IPetEquipPrxHelper";
import { ITreasurePrxHelper } from "../../../../Message/Game/ITreasurePrxHelper";
import { IWuXingPrxHelper } from "../../../../Message/Game/IWuXingPrxHelper";
import { IRunePrxHelper } from "../../../../Message/Game/IRunePrxHelper";
import { IAchievementPrxHelper } from "../../../../Message/Game/IAchievementPrxHelper";
import { IPetArenaPrxHelper } from "../../../../Message/Game/IPetArenaPrxHelper";
import { IGangFightsPrxHelper } from "../../../../Message/Game/IGangFightsPrxHelper";
import { IPetTitlePrxHelper } from "../../../../Message/Game/IPetTitlePrxHelper";
import { IAmuletPrxHelper } from "../../../../Message/Game/IAmuletPrxHelper";
import { ICountryPrxHelper } from "../../../../Message/Game/ICountryPrxHelper";
import { IRobIslandPrxHelper } from "../../../../Message/Game/IRobIslandPrxHelper";
import { RMIDispatcher } from "../../../../Engine/RMI/RMIDispatcher";
import { RMIEvent } from "../../../../Engine/RMI/RMIEvent";
import { MsgManager } from "../../manager/MsgManager";
import { RMISession } from "../../../common/net/RMISession";
import { MessageHandler } from "../MessageHandler";
import { RMISessionEvent } from "../RMISessionEvent";
//class GameRMI
    
    export  class GameRMI extends RMIBase
    {
        constructor()
        {
            
            super();this.iOprationPrx = new IOperationPrxHelper();
            this.loginGameProxy = new ILoginGamePrxHelper();
            this.iBagPrxHelper = new IBagPrxHelper();
            this.iItemPrxHelper = new IItemPrxHelper();
            this.iRolePrxHelper = new IRolePrxHelper();
            this.iMountsHelper = new IMountPrxHelper();
            this.iTaskHelper = new ITaskPrxHelper();
            this.iShopPrxHelper = new IShopPrxHelper();
            this.iInteractivePrxHelper = new IInteractivePrxHelper();
            this.iPlayerHelper = new IPlayerPrxHelper();
            this.iFriendPrxHelper = new IFriendPrxHelper();
            this.iMailPrxHelper = new IMailPrxHelper();
            this.iTestPrxHelper = new ITestPrxHelper();
            this.iWareHosueHelper = new IBagPrxHelper();
            this.iPlayerPrxHelper = new IPlayerPrxHelper();
            this.iBusinessPrxHelper = new IBusinessPrxHelper();
            this.iPetPrxHelper = new IPetPrxHelper();
            this.iPetHirePrxHelper = new IPetRentPrxHelper();
            this.iGroupPrxHelper = new IGroupPrxHelper();
            this.iPanicBuyPrxHelper = new IPanicBuyPrxHelper();
            this.iCopyPrxHelper = new ICopyPrxHelper();
            this.iOfflineExpPrxHelper = new IOfflineExpPrxHelper();
            this.iToplistPrxHelper = new IToplistPrxHelper();
            this.iGuildPrxHelper = new IGuildPrxHelper();
            this.iStallPrxHelper = new IStallPrxHelper();
            this.iTargetPrxHelper = new IComprehensionTargetPrxHelper();
            this.iRunBusinessPrxHelper = new IRunBusinessPrxHelper();
            this.iAcupointPrxHelper = new IAcupointPrxHelper();
            this.iTitleProxy = new ITitlePrxHelper();
            this.iMarketPrxHelper = new IMarketPrxHelper();
            this.iActive = new IActivePrxHelper();
            this.iDelegate = new IDelegatePrxHelper();
            this.iMarry = new IMarryPrxHelper();
            this.iPetEquip = new IPetEquipPrxHelper();
            this.iTreasure = new ITreasurePrxHelper();
            this.iWuxing = new IWuXingPrxHelper();
            this.iRune = new IRunePrxHelper();
            this.iAchievementPrxHelper = new IAchievementPrxHelper();
            this.iPetArenaHelper = new IPetArenaPrxHelper();
            this.iGangFights = new IGangFightsPrxHelper();
            this.iPetTitle = new IPetTitlePrxHelper();
            this.iAmulet = new IAmuletPrxHelper();
            this.countryPrxHelper = new ICountryPrxHelper();
            this.iRobIsland = new IRobIslandPrxHelper();
            if (GameRMI._instance != null) 
            {
                throw new Error(" GameRMI 单例 ");
            }
            // new Regist();
            RMIDispatcher.getInstance().addEventListener(RMIEvent.RMI_ERROR, this.onRmiErrorHandler);
            return;
        }

        /* internal  */onRmiErrorHandler(arg1: RMIEvent): void
        {
            MsgManager.systemError(arg1.error);
            return;
        }

        public /* override */ set rmiSession(arg1: RMISession)
        {
            arg1.session.messageHandler = new MessageHandler();
            arg1.session.communicator.sessionEvent = new RMISessionEvent();
            super.rmiSession = arg1;
            return;
        }

        public static get instance(): GameRMI
        {
            if (GameRMI._instance == null) 
            {
                GameRMI._instance = new GameRMI();
            }
            return GameRMI._instance;
        }

        protected /* override */ initProxy(): void
        {
            this.session.registerProxy(this.iOprationPrx);
            this.session.registerProxy(this.loginGameProxy);
            this.session.registerProxy(this.iBagPrxHelper);
            this.session.registerProxy(this.iRolePrxHelper);
            this.session.registerProxy(this.iTestPrxHelper);
            this.session.registerProxy(this.iItemPrxHelper);
            this.session.registerProxy(this.iTaskHelper);
            this.session.registerProxy(this.iMountsHelper);
            this.session.registerProxy(this.iShopPrxHelper);
            this.session.registerProxy(this.iWareHosueHelper);
            this.session.registerProxy(this.iInteractivePrxHelper);
            this.session.registerProxy(this.iMailPrxHelper);
            this.session.registerProxy(this.iFriendPrxHelper);
            this.session.registerProxy(this.iPlayerHelper);
            this.session.registerProxy(this.iBusinessPrxHelper);
            this.session.registerProxy(this.iPlayerPrxHelper);
            this.session.registerProxy(this.iPetPrxHelper);
            this.session.registerProxy(this.iGroupPrxHelper);
            this.session.registerProxy(this.iPanicBuyPrxHelper);
            this.session.registerProxy(this.iCopyPrxHelper);
            this.session.registerProxy(this.iOfflineExpPrxHelper);
            this.session.registerProxy(this.iToplistPrxHelper);
            this.session.registerProxy(this.iGuildPrxHelper);
            this.session.registerProxy(this.iStallPrxHelper);
            this.session.registerProxy(this.iTargetPrxHelper);
            this.session.registerProxy(this.iRunBusinessPrxHelper);
            this.session.registerProxy(this.iAcupointPrxHelper);
            this.session.registerProxy(this.iTitleProxy);
            this.session.registerProxy(this.iMarketPrxHelper);
            this.session.registerProxy(this.iPetHirePrxHelper);
            this.session.registerProxy(this.iActive);
            this.session.registerProxy(this.iDelegate);
            this.session.registerProxy(this.iMarry);
            this.session.registerProxy(this.iPetEquip);
            this.session.registerProxy(this.iTreasure);
            this.session.registerProxy(this.iWuxing);
            this.session.registerProxy(this.iRune);
            this.session.registerProxy(this.iAchievementPrxHelper);
            this.session.registerProxy(this.iPetArenaHelper);
            this.session.registerProxy(this.iGangFights);
            this.session.registerProxy(this.iPetTitle);
            this.session.registerProxy(this.iAmulet);
            this.session.registerProxy(this.countryPrxHelper);
            this.session.registerProxy(this.iRobIsland);
            return;
        }

        public /* var */iBagPrxHelper: IBagPrxHelper;

        public /* var */iItemPrxHelper: IItemPrxHelper;

        public /* var */iRolePrxHelper: IRolePrxHelper;

        public /* var */iMountsHelper: IMountPrxHelper;

        public /* var */iTaskHelper: ITaskPrxHelper;

        public /* var */iShopPrxHelper: IShopPrxHelper;

        public /* var */iInteractivePrxHelper: IInteractivePrxHelper;

        public /* var */iPlayerHelper: IPlayerPrxHelper;

        public /* var */iFriendPrxHelper: IFriendPrxHelper;

        public /* var */iMailPrxHelper: IMailPrxHelper;

        public /* var */iTestPrxHelper: ITestPrxHelper;

        public /* var */iWareHosueHelper: IBagPrxHelper;

        public /* var */iPlayerPrxHelper: IPlayerPrxHelper;

        public /* var */iBusinessPrxHelper: IBusinessPrxHelper;

        public /* var */iPetPrxHelper: IPetPrxHelper;

        public /* var */iPetHirePrxHelper: IPetRentPrxHelper;

        public /* var */iGroupPrxHelper: IGroupPrxHelper;

        public /* var */iPanicBuyPrxHelper: IPanicBuyPrxHelper;

        public /* var */iCopyPrxHelper: ICopyPrxHelper;

        public /* var */iOfflineExpPrxHelper: IOfflineExpPrxHelper;

        public /* var */iToplistPrxHelper: IToplistPrxHelper;

        public /* var */iGuildPrxHelper: IGuildPrxHelper;

        public /* var */iStallPrxHelper: IStallPrxHelper;

        public /* var */iTargetPrxHelper: IComprehensionTargetPrxHelper;

        public /* var */iRunBusinessPrxHelper: IRunBusinessPrxHelper;

        public /* var */iAcupointPrxHelper: IAcupointPrxHelper;

        public /* var */iTitleProxy: ITitlePrxHelper;

        public /* var */iMarketPrxHelper: IMarketPrxHelper;

        public /* var */iActive: IActivePrxHelper;

        public /* var */iDelegate: IDelegatePrxHelper;

        public /* var */iMarry: IMarryPrxHelper;

        public /* var */iPetEquip: IPetEquipPrxHelper;

        public /* var */iOprationPrx: IOperationPrxHelper;

        public /* var */iWuxing: IWuXingPrxHelper;

        public /* var */iRune: IRunePrxHelper;

        public /* var */iAchievementPrxHelper: IAchievementPrxHelper;

        public /* var */iPetArenaHelper: IPetArenaPrxHelper;

        public /* var */iGangFights: IGangFightsPrxHelper;

        public /* var */iTreasure: ITreasurePrxHelper;

        public /* var */iAmulet: IAmuletPrxHelper;

        public /* var */countryPrxHelper: ICountryPrxHelper;

        public /* var */iRobIsland: IRobIslandPrxHelper;

        public /* var */loginGameProxy: ILoginGamePrxHelper;

        private static /* var */_instance: GameRMI;

        public /* var */iPetTitle: IPetTitlePrxHelper;
    }
